home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Palettes / MiscArrowButtonPalette / MiscArrowButton.subproj / MiscArrowButtonCell.h < prev    next >
Encoding:
Text File  |  1994-10-01  |  1.9 KB  |  59 lines

  1. /******************************************************************
  2.   CLASS:            MiscArrowButtonCell
  3.   INHERITS FROM:     ButtonCell
  4.   PROGRAMMER:        Todd Thomas, Copyright 1993, 1994 by Todd Thomas
  5.   START DATE:        Jan 16, 1993
  6.   LAST CHANGED:        Oct. 1, 1994
  7.   VERSION             1.1
  8.   CHANGES:            See the end of the implementation file.
  9.   
  10.   With the help of ArrowButton, this is a recreation of the 
  11.   button (well, it was a View there) from Websters.app (in the 
  12.   Preferences panel). 
  13.   
  14.   I created a new designated initializer, since it would be nice
  15.   to be able to set both sides of the button at once. Also, since
  16.   stringValue did not return anything useful, I made it return a
  17.   pointer to either the contents (state 0) or altContents (state 1).
  18.   
  19.   This object is included in the MiscKit by permission from the author
  20.   and its use is governed by the MiscKit license, found in the file
  21.   "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  22.   for a list of all applicable permissions and restrictions.
  23.  *******************************************************************/
  24.  
  25. #import <appkit/appkit.h>
  26.  
  27. // Use the method setArrowAlignment: with these defines
  28. // Used to use method setAlignment: but realized I still needed that method
  29.  
  30. #define MISC_ARROW_ABSOLUTE 0
  31. #define MISC_ARROW_RELATIVE 1
  32.  
  33.  
  34. @interface MiscArrowButtonCell : ButtonCell
  35. {
  36.     float  cellHeight;
  37.     unsigned int  arrowAlignment;
  38. }
  39.  
  40. + initialize;
  41. - init;
  42. - initTextCell: (const char *)aString;
  43. - initTextCell: (const char *)aString altTitle: (const char *)altString;
  44.  
  45. - (const char *)stringValue;
  46. - calcCellSize: (NXSize *)theSize inRect: (NXRect *)theRect;
  47. - getTitleRect: (NXRect *)theRect;
  48. - getAltTitleRect: (NXRect *)theRect;
  49. - setArrowAlignment: (int)alignment;
  50. - (int)arrowAlignment;
  51.  
  52. - drawInside: (const NXRect *)cellFrame inView: controlView;
  53. - drawSelf: (const NXRect *)cellFrame inView: controlView;
  54.  
  55. - read: (NXTypedStream *)stream;
  56. - write: (NXTypedStream *)stream;
  57.  
  58. @end
  59.